#ifndef FFMPEGPROGRESS_H
#define FFMPEGPROGRESS_H

#include <QPaintEvent>
#include <QPainter>
#include <QProgressBar>
#include <QFile>
#include <QTextStream>
#include <QDebug>
#include <QTimer>

class FFmpegProgress : public QProgressBar
{
    Q_OBJECT
public:
    explicit FFmpegProgress(QWidget *parent = 0);
    void setPersent(int persent);

private:
    int m_persent;
    int rotateAngle;
    QTimer *myTimer;
    int msDelay;
    QString filePath;
    QFile *file;
    QTextStream *fileStream;

protected:
    void paintEvent(QPaintEvent *);

public slots:
    void updateFilePath(QString f);
    void startProcess();
    void stopProcess();
    void setInterval(int ms);
    void process();
    void closeFile();

signals:
    void inProcess(qint64 p);
    void onFinish();

};


#endif // FFMPEGPROGRESS_H
